var o=5
var sum1=1,sum2=1,sum3=0;
function getSum(n){
	if (n===1){
		return "1"
	}
		if (n===2){
		return "1"
	}
	for (a=3;a<=n ;a++ )
	{
	  sum3 = sum1+sum2;
      sum1 = sum2;
      sum2 = sum3;
	}
 return sum3;
}
var p = getSum(o);
console.log("第"+o+"项"+"为"+" "+p);


function fid(n){
	for(var i =3,n1=1,n2=1;i <= n;i++){
			var c = n2;
			n2 = n1 +n2;
			n1 = c
		console.log(n2);
	}
		return n2;
}
var o = fid(5)
console.log(o)